﻿<sdk:ChildWindow
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:gui="clr-namespace:Earthwatchers.UI.GUI.Controls"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
    xmlns:loaders="clr-namespace:Earthwatchers.UI.GUI.Loaders"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="Earthwatchers.UI.GUI.Controls.PollsWindow" 
    Width="720"
    Padding="0"
    Title="{Binding Path=Polls5, Source={StaticResource Labels}}"
    HasCloseButton="True"
    FontSize="15"
    Style="{StaticResource GPDefaultChildWindow}">
    <sdk:ChildWindow.Resources>
        <Storyboard x:Name="BonusStoryBoard">
            <DoubleAnimation BeginTime="0:0:0" Duration="0:0:0.5" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Bonus">
                <DoubleAnimation.EasingFunction>
                    <QuadraticEase EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation BeginTime="0:0:0.5" Duration="0:0:0.5" To="30" Storyboard.TargetProperty="BlurRadius" Storyboard.TargetName="BonusEffect">
                <DoubleAnimation.EasingFunction>
                    <QuadraticEase EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>

            <DoubleAnimationUsingKeyFrames BeginTime="0:0:1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BonusText">
                <EasingDoubleKeyFrame KeyTime="0:0:0" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuadraticEase EasingMode="EaseInOut" />
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuadraticEase EasingMode="EaseInOut" />
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <QuadraticEase EasingMode="EaseInOut" />
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimation BeginTime="0:0:1" Duration="0:0:1" To="-40" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="BonusText">
                <DoubleAnimation.EasingFunction>
                    <QuadraticEase EasingMode="EaseInOut" />
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
        </Storyboard>
    </sdk:ChildWindow.Resources>
    
    <Grid>
        <Border>
            <Border.Background>
                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Color="White" Offset="0.9"></GradientStop>
                    <GradientStop Color="#FFe0e0e0" Offset="1"></GradientStop>
                </LinearGradientBrush>
            </Border.Background>
            
            <Grid x:Name="LayoutRoot">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.ColumnSpan="2" FontSize="17" FontWeight="Bold" FontFamily="Arial" Foreground="#FF333333" Text="{Binding Path=Polls1, Source={StaticResource Labels}}" Margin="10,10" />
                
                <Image x:Name="BeforeImage" ImageFailed="Image_ImageFailed" ImageOpened="Image_ImageOpened" Grid.Row="1" Margin="10" Width="256" Height="256" />
                <TextBlock FontSize="15" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontFamily="Arial" FontWeight="Bold" Foreground="#FFA0BB0E" Text="2008" Margin="0,0,20,20" IsHitTestVisible="False" />

                <Image x:Name="AfterImage" ImageFailed="Image_ImageFailed" ImageOpened="Image_ImageOpened" Grid.Row="1" Grid.Column="1" Margin="10" Width="256" Height="256" />
                <TextBlock x:Name="LastSatImgText" FontSize="15" Grid.Row="1" Grid.Column="1"  HorizontalAlignment="Right" VerticalAlignment="Bottom" FontFamily="Arial" FontWeight="Bold" Foreground="#FFA0BB0E" Margin="0,0,20,20" IsHitTestVisible="False" />

                <Grid Grid.Column="2" Grid.RowSpan="2" VerticalAlignment="Center">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Button x:Name="ButtonYes" Style="{StaticResource GreenButton}" HorizontalAlignment="Center"  Width="150" Cursor="Hand" Height="35" Foreground="White" FontSize="16" Content="{Binding Path=Notifications4, Source={StaticResource Labels}}" Margin="0,10" Click="ActionButton_Click" />
                    <Button x:Name="ButtonDontKnow" Style="{StaticResource GrayButton}" Grid.Row="2" Width="150" Cursor="Hand" Height="35" FontSize="15" Content="{Binding Path=Polls4, Source={StaticResource Labels}}" Margin="0,10" Click="ActionButton_Click" />
                    <Button x:Name="ButtonNo" Style="{StaticResource RedButton}" Grid.Row="1" HorizontalAlignment="Center" Width="150" Cursor="Hand" Height="35" Foreground="White" FontSize="16" Content="NO" Margin="0,10" Click="ActionButton_Click" />

                </Grid>
                <loaders:_3D x:Name="loadinAnim" Grid.ColumnSpan="2" Grid.Row="1" Height="22" Visibility="Visible" IsHitTestVisible="False" />
                
                <Grid Grid.Row="3" Margin="0,10,0,0" Grid.ColumnSpan="3">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Grid.Background>
                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                            <GradientStop Color="#FFe4e4e4" Offset="0"></GradientStop>
                            <GradientStop Color="#FFcbcdcc" Offset="1"></GradientStop>
                        </LinearGradientBrush>
                    </Grid.Background>
                    <TextBlock Grid.Row="0"
                               Width="550"
                               Foreground="#FF333333"
                               Margin="20,10,0,10"
                               FontFamily="Arial"
                               VerticalAlignment="Center"
                               FontSize="13"
                               HorizontalAlignment="Left"
                               TextAlignment="Left"
                               TextWrapping="Wrap">
                        <Run Text="{Binding Path=Polls7, Source={StaticResource Labels}}" />
                        <LineBreak /><LineBreak /><Run Text="{Binding Path=Polls8, Source={StaticResource Labels}}" FontWeight="Bold" />
                        <Run Text="{Binding Path=Polls9, Source={StaticResource Labels}}" />
                        <Run Text="{Binding Path=Polls10, Source={StaticResource Labels}}" FontWeight="Bold" />
                        <Run Text="{Binding Path=Polls11, Source={StaticResource Labels}}" />
                    </TextBlock>
                    <Grid Grid.Row="1" x:Name="BonusGrid" Visibility="Collapsed" Margin="0,7,0,7">
                    <Rectangle x:Name="Rectangle2" Height="12" Width="95" Fill="{StaticResource BackGroundRectWhite}" HorizontalAlignment="Left" Margin="50,0,0,0" />
                    <Rectangle x:Name="Rectangle3" Height="12" Width="95" Fill="{StaticResource BackGroundRectWhite}" HorizontalAlignment="Left" Margin="170,0,0,0" />
                    <Rectangle x:Name="Rectangle4" Height="12" Width="95" Fill="{StaticResource BackGroundRectWhite}" HorizontalAlignment="Left" Margin="290,0,0,0" />
                    <Rectangle x:Name="Rectangle5" Height="12" Width="95" Fill="{StaticResource BackGroundRectWhite}" HorizontalAlignment="Left" Margin="410,0,0,0" />
                    <Ellipse x:Name="Circle1" Width="36" Height="36" Fill="{StaticResource BackGroundEllipseWhite}" HorizontalAlignment="Left" Margin="20,0,0,0" />
                    <Ellipse x:Name="Circle2" Width="36" Height="36" Fill="{StaticResource BackGroundEllipseWhite}" HorizontalAlignment="Left" Margin="140,0,0,0" />
                    <Ellipse x:Name="Circle3" Width="36" Height="36" Fill="{StaticResource BackGroundEllipseWhite}" HorizontalAlignment="Left" Margin="260,0,0,0" />
                    <Ellipse x:Name="Circle4" Width="36" Height="36" Fill="{StaticResource BackGroundEllipseWhite}" HorizontalAlignment="Left" Margin="380,0,0,0" />
                    <Ellipse x:Name="Circle5" Width="36" Height="36" Fill="{StaticResource BackGroundEllipseWhite}" HorizontalAlignment="Left" Margin="500,0,0,0" />
                    <TextBlock Text="1" Foreground="#FF333333" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="34,0,0,0" FontWeight="Bold" FontFamily="Arial" />
                    <TextBlock Text="2" Foreground="#FF333333" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="154,0,0,0" FontWeight="Bold" FontFamily="Arial" />
                    <TextBlock Text="3" Foreground="#FF333333" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="274,0,0,0" FontWeight="Bold" FontFamily="Arial" />
                    <TextBlock Text="4" Foreground="#FF333333" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="394,0,0,0" FontWeight="Bold" FontFamily="Arial" />
                    <TextBlock Text="5" Foreground="#FF333333" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="514,0,0,0" FontWeight="Bold" FontFamily="Arial" />
                    </Grid>
                    <Image Visibility="Collapsed" Source="../../Resources/Images/bonus.png" x:Name="Bonus" Stretch="None" Grid.RowSpan="2" HorizontalAlignment="Right" Margin="0,0,40,0" Opacity="0.2">
                        <Image.Effect>
                            <DropShadowEffect ShadowDepth="0" BlurRadius="0" Color="#FFA0BB0E" x:Name="BonusEffect" />
                        </Image.Effect>
                    </Image>
                    <TextBlock Visibility="Collapsed" x:Name="BonusText" HorizontalAlignment="Right" Margin="0,0,65,0" Text="1000" Foreground="#FF333333" FontSize="13" VerticalAlignment="Center" Grid.RowSpan="2" Opacity="0">
                        <TextBlock.RenderTransform>
                            <TranslateTransform Y="0" />
                        </TextBlock.RenderTransform>
                    </TextBlock>
                </Grid>
            </Grid>
        </Border>
    </Grid>


</sdk:ChildWindow>